package com.example.administrator.printer.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.example.administrator.printer.entity.DiscountEntity;
import com.example.administrator.printer.entity.OrderingEntity;
import com.example.administrator.printer.entity.OrderingExtendEntity;

import java.util.ArrayList;
import java.util.List;

public class BaseActivity extends AppCompatActivity {
    public OrderingEntity order;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        initData();
    }

    /**
     * 模拟订单数据
     */
    private void initData() {
        order = new OrderingEntity();
        order.setStoreName("沃头蚝干粥");
        order.setTable_num("餐桌01");
        order.setToday_order_num(02);
        order.setIf_parent_order_id(false);
        order.setOrder_sn("10872368981596");
        order.setBuyer_phone("13314944809");
        order.setIsonline(0);

        OrderingExtendEntity g1 = new OrderingExtendEntity();
        g1.setGoods_name("小米粥");
        g1.setGoods_num("1");
        g1.setGoods_spec("分量：中");
        g1.setGoods_pay_price("8.00");

        OrderingExtendEntity g2 = new OrderingExtendEntity();
        g2.setGoods_name("蚝干蟹黄粥");
        g2.setGoods_spec("分量：小");
        g2.setGoods_num("1");
        g2.setGoods_pay_price("12.00");

        OrderingExtendEntity g3 = new OrderingExtendEntity();
        g3.setGoods_name("五香条");
        g3.setGoods_num("10");
        g3.setGoods_pay_price("30.00");

        List<OrderingExtendEntity> goods = new ArrayList<>();
        goods.add(g1);
        goods.add(g2);
        goods.add(g3);
        order.setExtend_order_goods(goods);

        order.setNumber_of_people("1");
        order.setTableware_fee("1.00");

        DiscountEntity discount = new DiscountEntity();
        discount.setTitle("满减");
        discount.setPrice("-￥15.00");
        List<DiscountEntity> discounts = new ArrayList<>();
        discounts.add(discount);
        order.setOrder_discount(discounts);

        order.setGoods_amount("51.00");
        order.setOrder_amount("36.00");

        order.setOrder_message("少盐");
    }
}
